﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace 家庭助手
{
    public partial class User : Form
    {
        public User()
        {
            InitializeComponent();
        }

        private void User_Load(object sender, EventArgs e)
        {
            Text += "!!!";
            listView1.Visible = true;
            listView2.Visible = false;
            listView3.Visible = false;
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch(comboBox1.Text)
            {
                case("款项类型管理"):listView1.Visible = true;
                                     listView2.Visible = false;
                                     listView3.Visible = false;
                                     break;
                case("收入、支出管理"):listView1.Visible = false;
                                       listView2.Visible = true;
                                       listView3.Visible = false;
                                       break;
                case("日志管理"):listView1.Visible = false;
                                 listView2.Visible = false;
                                 listView3.Visible = true;
                                 break;
               /* default:listView1.Visible = false;
                        listView2.Visible = false;
                        listView3.Visible = false;*/
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            switch (comboBox1.Text)
            {
                case ("款项类型管理"): 
                    kuanxiang k = new kuanxiang();
                    k.Text += "新增";
                    k.ShowDialog();
                    break;
                case ("收入、支出管理"):
                    incomes i = new incomes();
                    i.Text += "新增";
                    i.ShowDialog();
                    break;
                case ("日志管理"):
                    diary d = new diary();
                    d.Text += "新增";
                    d.ShowDialog();
                    break;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            switch (comboBox1.Text)
            {
                case ("款项类型管理"):
                    kuanxiang k = new kuanxiang();
                    k.Text += "修改";
                    k.ShowDialog();
                    break;
                case ("收入、支出管理"):
                    incomes i = new incomes();
                    i.Text += "修改";
                    i.ShowDialog();
                    break;
                case ("日志管理"):
                    diary d = new diary();
                    d.Text += "修改";
                    d.ShowDialog();
                    break;
            }
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            entertainment e1 = new entertainment();
            e1.Show();
        }
    }
}
